home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Panorama / Panorama - Disk 01 (1986-02-15)(Pacific North-West Amigas Club)[h AFL][b corrupt files].zip / Panorama - Disk 01 (1986-02-15)(Pacific North-West Amigas Club)[h AFL][b corrupt files].adf / mand.h < prev    next >
Text File  |  1989-10-24  |  7KB  |  226 lines

  1. /*
  2.               MAND.H -- The Constants and Definitions
  3.              Mandelbrot Self-Squared Dragon Generator
  4.                     For the Commodore Amiga
  5.                          Version 2.01
  6.  
  7.                       Accompanies MAND.C
  8.  
  9.              Copyright (c) 1985, Robert S. French
  10.                   Placed in the Public Domain
  11.  
  12.               Vastly Enhanced by =RJ Mical=  1985
  13.  
  14. This program may be distributed free of charge as long as the above
  15. notice is retained.
  16.  
  17. */
  18.  
  19.  
  20. /*-------------------*/
  21. /* Lots of includes! */
  22.  
  23. #include <exec/types.h>
  24. #include <exec/tasks.h>
  25. #include <exec/libraries.h>
  26. #include <exec/devices.h>
  27. #include <devices/keymap.h>
  28. #include <graphics/copper.h>
  29. #include <graphics/display.h>
  30. #include <graphics/gfxbase.h>
  31. #include <graphics/text.h>
  32. #include <graphics/view.h>
  33. #include <graphics/gels.h>
  34. #include <graphics/regions.h>
  35. #include <hardware/blit.h>
  36. #include <intuition/intuition.h>
  37. #include <intuition/intuitionbase.h>
  38. #include <stdio.h>
  39.  
  40. #include <libraries/dos.h>
  41.  
  42. #include <workbench/workbench.h>
  43.  
  44. #include "iff.h"
  45.  
  46.  
  47. /*-------------------*/
  48. /* Misc. definitions */
  49. #define VERSION "2.01"
  50.  
  51. #define F_INTUITION 0x000001
  52. #define F_GRAPHICS  0x000002
  53. #define F_MATH      0x000004
  54. #define F_MATHTRANS 0x000008
  55. #define F_CONSOLE   0x000010
  56. #define F_COLORTAB  0x000020
  57. #define F_SETSTORE  0x000040
  58. #define F_ICON      0x000080
  59.  
  60.  
  61. #define EVER ;;
  62. #define MAXX 640
  63. #define MAXY 400
  64. #define MAXMY 100
  65. #define STARTY 0
  66. #define PROCESS_STACKSIZE 6000
  67.  
  68. /*---------------------------------*/
  69. /* Fast-Floating-Point Definitions */
  70.  
  71. extern   int     SPFix();
  72. extern   int     SPFlt();
  73. extern   int     SPCmp();
  74. extern   int     SPTst();
  75. extern   int     SPAbs();
  76. extern   int     SPNeg();
  77. extern   int     SPAdd();
  78. extern   int     SPSub();
  79. extern   int     SPMul();
  80. extern   int     SPDiv();
  81.  
  82. extern   int     SPAtan();
  83. extern   int     SPSin();
  84. extern   int     SPCos();
  85. extern   int     SPTan();
  86. extern   int     SPSincos();
  87. extern   int     SPSinh();
  88. extern   int     SPCosh();
  89. extern   int     SPTanh();
  90. extern   int     SPExp();
  91. extern   int     SPLog();
  92. extern   int     SPPow();
  93. extern   int     SPSqrt();
  94. extern   int     SPTieee();
  95. extern   int     SPFieee();
  96.  
  97.  
  98. #define TOPW2 w2->BorderTop
  99. #define BOTTOMW2 (w2->Height - w2->BorderBottom)
  100. #define LEFTW2 w2->BorderLeft
  101. #define RIGHTW2 (w2->Width - w2->BorderRight)
  102.  
  103.  
  104. /* === these definitions are for the color_mode variable ================== */
  105. #define NOT_HOLDANDMODIFY       0x0001
  106. #define INTERLACE_MODE          0x0002
  107. #define HIRES_MODE              0x0004
  108.  
  109. /* === these definitions are for the menu strips ========================== */#define ITEM_HEIGHT 10
  110. #define MENU_PROJECT 0  /* first menu */
  111. #define MENU_OPTIONS 1  /* next menu */
  112. #define MENU_ZOOM 2     /* next menu */
  113. #define MENU_COUNT 3
  114.  
  115. /* for the PROJECT Menu ... */
  116. #define PROJECT_WIDTH   176
  117. #define PROJECT_SAVEPICTURE 0
  118. #define PROJECT_COUNT        1
  119.  
  120. /* for the OPTIONS Menu ... */
  121. #define OPTIONS_WIDTH   176
  122. #define OPTIONS_LEFT       (-24)
  123. #define OPTIONS_QUARTER 0
  124. #define OPTIONS_FULL    1
  125. #define OPTIONS_GENERATE 2
  126. #define OPTIONS_COLORS  3
  127. #define OPTIONS_STOP    4
  128. #define OPTIONS_CLOSE   5
  129. #define OPTIONS_COUNT   6
  130.  
  131. /* for the ZOOM Menu ... */
  132. #define ZOOM_WIDTH   222
  133. #define ZOOM_LEFT       (-60)
  134. #define ZOOM_SETCENTER    0
  135. #define ZOOM_SIZEBOX      1
  136. #define ZOOM_SIZEPROP     2
  137. #define ZOOM_ZOOMIN       3
  138. #define ZOOM_ZOOMIN10     4
  139. #define ZOOM_ZOOMOUT2     5
  140. #define ZOOM_ZOOMOUT10    6
  141. #define ZOOM_COUNT        7
  142.  
  143.  
  144. /* === the definitions for the ColorWindow ================================ */
  145. #define COLOR_KNOB_BODY         0x1111
  146.  
  147. #define COLORWINDOW_WIDTH       208
  148. #define COLORWINDOW_HEIGHT      91
  149.  
  150. #define DEFAULT_WINDOW_LEFT     (320 - COLORWINDOW_WIDTH)
  151. #define DEFAULT_WINDOW_TOP      (200 - COLORWINDOW_HEIGHT)
  152.  
  153. #define CHARACTER_WIDTH         8
  154. #define CHARACTER_HEIGHT        8
  155.  
  156. #define COLOR_BOX_LEFT          7
  157. #define COLOR_BOX_TOP           6
  158. #define COLOR_BOX_RIGHT         (COLOR_BOX_LEFT + 15)
  159. #define COLOR_BOX_BOTTOM        (COLOR_BOX_TOP + 29)
  160. #define COLOR_COLOR_TOP         45
  161. #define COLOR_PROP_LEFT         38
  162. #define COLOR_PROP_TOP          4
  163. #define COLOR_PROP_WIDTH        165
  164. #define COLOR_PROP_HEIGHT       10
  165. #define COLOR_CLUSTER_LEFT      141
  166. #define COLOR_CLUSTER_TOP       41
  167. #define COLOR_CLUSTER_WIDTH     (CHARACTER_WIDTH * 6 + 4)
  168. #define COLOR_CLUSTER_HEIGHT    9
  169. #define COLOR_HSL_TOP           (COLOR_BOX_TOP - 2)
  170. #define COLOR_HSL_LEFT          (COLOR_BOX_RIGHT + 3)
  171.  
  172. /* GREEN and RED are out of order.  Do you wonder why?  Some day I'll 
  173.  * tell you.  =RJ=
  174.  */
  175. #define COLOR_COPY              32
  176. #define COLOR_RANGE             33
  177. #define COLOR_OK                34
  178. #define COLOR_CANCEL            35
  179. #define COLOR_GREEN             36
  180. #define COLOR_RED               37
  181. #define COLOR_BLUE              38
  182. #define COLOR_HSL_RGB           39
  183. #define COLOR_GADGETS_COUNT     40
  184.  
  185.  
  186.  
  187. /* === Our Definitions for the IFF Format ================================= */
  188.  
  189. struct  BitMapHeader
  190. {
  191.         USHORT  w;
  192.         USHORT  h;
  193.         SHORT   x, y;
  194.         UBYTE   nPlanes, masking, compression, pad1;
  195.         USHORT  TransparentColor;
  196.         UBYTE   xAspect, yAspect;
  197.         SHORT   PageWidth, PageHeight;
  198. };
  199.  
  200. struct  PaintingHeader
  201. {
  202.         LONG    IFFID, FileLength, ILBMID, BMHDID, BitMapSize;
  203.         struct  BitMapHeader BitMapHeader;
  204.         LONG    CMAP, CMAPlength;
  205. };
  206.  
  207. /* the MakeID macro is defined in iff.h */
  208. #define ILBM                    MakeID('I','L','B','M')
  209. #define BMHD                    MakeID('B','M','H','D')
  210. #define BODY                    MakeID('B','O','D','Y')
  211. #define CMAP                    MakeID('C','M','A','P')
  212. #define CAMG                    MakeID('C','A','M','G')
  213.  
  214. /* ======================================================================== */
  215.  
  216. /* This constant is for Intuition V1.1.  If you are getting "redefinition"
  217.  * warnings when you compile, it's because of this redeclaration.  
  218.  * Is harmless, and when we all get to V1.1 then we all can delete this.
  219.  */
  220. #define INTUITICKS 0x00400000
  221. MpP[tD F5<P    15JMANDELBROT C SOURCE RJMC source file for R J Mical (Author of Intuition) version of Mandelbrot
  222. program. Use Lattice C 3.03 to compile. You need the following to make up
  223. the whole program: IFF.H MAND.H MAND.C MAND1.C MAND2.C MAND3.C MAND4.C
  224. MAND5.C MAND6.C MAND7.C Example of how to use Intuition from the man that
  225. wrote it.
  226.